<?php

namespace app\admin\model\yexam;

use think\Model;

class QuestionType extends Model
{
    // 表明
    protected $name = 'yexam_question_type';
    protected $pk ='questid';
    // 更新时间
    protected $updateTime = 'update_time';
    // 创建时间
    protected $createTime = 'create_time';
    //
    protected $autoWriteTimestamp = 'int';
    protected function getCreateTimeAttr($val)
    {
        return date('Y-m-d H:i:s',$val);
    }
    // 题型分类
    protected function getQuestionCategoryAttr($val){
        switch ($val)
        {
            case 1: return '单选';
            case 2: return '多选';
            case 3: return '判断';
        }
    }
}